package by.epam.xslttask.managers;

import by.epam.xslttask.logger.LoggerType;
import by.epam.xslttask.logger.XSLTLogger;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * Created by IntelliJ IDEA.
 * User: Darya_Hrishanovich
 * Date: 7/6/12
 * Time: 4:42 AM
 * To change this template use File | Settings | File Templates.
 */
public class PathManager {
    private static ResourceBundle resourceBundle;

    public static final String PATHS = "properties.paths";
    public static final String XML = "xml";

    static {
        resourceBundle = ResourceBundle.getBundle(PATHS);
    }

    public static String getProperty(String key) {
        try {
            return resourceBundle.getString(key);
        } catch (MissingResourceException ex) {
            String message = LogManager.getProperty(LogManager.RES_MISSING);
            XSLTLogger.logMessage(message, LogManager.class, LoggerType.WARNING);
        }
        return "";
    }
}
